package com.dream.utils.hibernate;

import java.util.List;

import com.dream.utils.system.cfg.SystemConfigUtils;

/**
 * 
 * @author Evan
 * @date 2013-8-25
 * 
 */
public class PagingVO {
	
	private String pageIndex;
	
	private String pageSize;
	
	/**
	 * aa,asc|bb,desc
	 */
	private String orderName;
	
	private SqlOrder order;
	
	private List<?> details;

	private Long count;
	
	public PagingVO(){
		this.pageIndex = "1";
		this.pageSize = SystemConfigUtils.instance().getInteger("system.pagesize.default", 10).toString();
	}
	public String getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(String pageIndex) {
		this.pageIndex = pageIndex;
	}

	public String getPageSize() {
		return pageSize;
	}

	public void setPageSize(String pageSize) {
		this.pageSize = pageSize;
	}

	public String getOrderName() {
		return orderName;
	}

	public void setOrderName(String orderName) {
		this.orderName = orderName;
	}

	public SqlOrder getOrder() {
		return order;
	}

	public void setOrder(SqlOrder order) {
		this.order = order;
	}
	public List<?> getDetails() {
		return details;
	}
	public void setDetails(List<?> details) {
		this.details = details;
	}
	public Long getCount() {
		return count;
	}
	public void setCount(Long count) {
		this.count = count;
	}
	
	public static PagingVO initMaxSize(){
		
		PagingVO page = new PagingVO();
		page.setPageIndex("1");
		page.setPageSize(String.valueOf(Integer.MAX_VALUE-1));
		return page;
	}
	
}
